package com.binary.coder.gift.core.domain.ai.impl;

import com.binary.coder.gift.core.common.constant.AIModelType;
import com.binary.coder.gift.core.common.constant.ConversationType;
import com.binary.coder.gift.core.domain.ai.AiService;
import com.binary.coder.gift.core.domain.ai.model.XingHuoModeloutputParam;
import lombok.extern.slf4j.Slf4j;

/**
 * @author atao
 * @version 1.0.0
 * @ClassName XingHuoClient.java
 * @Description 星火大模型
 * @createTime 2024年07月12日 10:02:00
 */
@Slf4j
public class XingHuoClient extends AbstractXingHuoClient implements AiService<XingHuoModeloutputParam> {


    public XingHuoClient(String xinghuo_secretId, String xingghuo_secretKey) {
        super(xinghuo_secretId, xingghuo_secretKey);
    }

    @Override
    public String typeCode() {
        return AIModelType.XINGHUO.getTypeCode();
    }

    @Override
    public XingHuoModeloutputParam processConversation(ConversationType type, String data) {
        try {
            switch (type) {
                case TEXT:
                    return this.ChatCompletions(data);
                default:
                    break;
            }
        } catch (Exception e) {
            log.error("{}",e);
        }
        return null;
    }


}
